<div ng-include="sys_html('layout/_header')"></div>

<div class="ncm-container">



     <div ng-include="sys_html('layout/member/left-layout')"></div> 

    <div class="right-layout">

        <div class="wrap">

             <div ng-include="sys_html('layout/member/tabmenu')"></div> 
            
           <div class='fui-content' style='margin-top:5px;'>

                <div class="fui-cell-group">

                    <div class="fui-cell must">
                        <div class="fui-cell-label">手机号</div>
                        <div class="fui-cell-info"><input type="tel" class='fui-input' id='mobile' name='mobile'
                                                          placeholder="请输入您的手机号" ng-model="pagedata.member.mobile" 
                                                          maxlength="11"/></div>
                    </div>

                    <div class="fui-cell must">
                        <div class="fui-cell-label">验证码</div>
                        <div class="fui-cell-info"><input type="tel" class='fui-input' id='verifycode' name='verifycode'
                                                          placeholder="5位验证码"  ng-model="pagedata.member.verifycode"  value="" maxlength="5"/></div>
                        <div class="fui-cell-remark noremark"><a id="sms_code"  ng-click="sendcode()" class="btn btn-default btn-default-o btn-sm"
                                                                >获取验证码</a></div>
                    </div>
                    <div class="fui-cell must">
                        <div class="fui-cell-label">登录密码</div>
                        <div class="fui-cell-info"><input type="password" class='fui-input' id='pwd' name='pwd'
                                                          placeholder="请输入您的登录密码" ng-model="pagedata.member.pwd" value=""/></div>
                    </div>
                    <div class="fui-cell must">
                        <div class="fui-cell-label">确认密码</div>
                        <div class="fui-cell-info"><input type="password" class='fui-input' id='pwd1' name='pwd1'
                                                          placeholder="请输入确认登录密码" ng-model="pagedata.member.pwd1" value=""/></div>
                    </div>

                </div>

                <a href='#' ng-click="post(pagedata.member,'post')" id='btnSubmit' class='btn btn-success block'>立即绑定</a>
            </div>
        </div>
    </div>
</div>


<div ng-include="sys_html('layout/_footer')"></div>
<script>
scope.pagedata.ice_menu_array[0].menu_name='Change the binding';
</script>
<script>
window.scope.sendcode=function(){
	var mobile=window.scope.pagedata.member.mobile;
		if(mobile==null){
		alert('请输入手机号！');
		return false;
	}
	if(mobile.length!=11){
		alert('请输入正确的手机号！');
		return false;
	}
	var d=$('#sms_code').text();
	if(d!='重新获取' && d!='获取验证码'){
		return false;
	}
	window.scope.post({'mobile':mobile},'sendcode','',function(res){
		if(res=='success'){
			setTimeout(function(){countdown(59);},1000);
		}else{
			window.scope.message('验证码发送失败！');
		}
	});
}
function countdown(start){
		if(start>0){
			$('#sms_code').text(start+'后重新发送');
			start=start-1;
			setTimeout(function(){countdown(start);},1000);
		}else{
			
			$('#sms_code').text('重新获取');
		}
	}
</script>